package Calculator.Add;/*
 * Author: AMark
 * Date:10/18/2023
 * Time:9:22 AM
 */

import Calculator.MyActionListener;

import javax.swing.*;
import java.awt.*;

public class CalculatorAddTest {

    private JFrame CalFrame;
    public JTextField Text1, Text2, Result;
    private JLabel Add;
    public JButton Equals;
    public static int result = 0;

    CalculatorAddTest() {
        CalFrame = new JFrame("Calculator");
        CalFrame.setSize(400, 50);
        Text1 = new JTextField(5);
        Text2 = new JTextField(5);
        Result = new JTextField(5);
        Add = new JLabel("+");
        Equals = new JButton("=");

        CalFrame.add(Text1);
        CalFrame.add(Add);
        CalFrame.add(Text2);
        CalFrame.add(Equals);
        CalFrame.add(Result);
        Equals.addActionListener(new MyActionListener(this));

        CalFrame.setLayout(new FlowLayout());
        CalFrame.setVisible(true);
        CalFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    }
    public static void main(String[] args) {
        new CalculatorAddTest();
    }
}